import { takeEvery, put, delay } from 'redux-saga/effects';
import { add } from '../actions/conter.actions.js';

// takeEvery 接收 action
// put 触发 action

function* increment_async_fn(action) {
    yield delay(2000);
    yield put(add(action.payload))
}

export default function* counterSaga() {
    // 接收action,处理action
    yield takeEvery("add_async", increment_async_fn)
}